﻿@{
    if (false)
    {
        <script src="~/LiberUI/Scripts/jquery.js"></script>
        <script src="~/LiberUI/Scripts/LiberUI.Base.js"></script>
        <script src="~/LiberUI/Scripts/LiberUI.js"></script>
        <script src="~/LiberUI/Scripts/LiberUI.Action.js"></script>
    }
}

<div id="tplPrompt" style="display:none">
    <div class="prompt_success">
        <div class="p_body">
            <h4>title</h4>
            <span>message</span>
        </div>
    </div>
    <div class="prompt_info">
        <div class="p_body">
            <h4>title</h4>
            <span>message</span>
        </div>
    </div>
    <div class="prompt_err">
        <div class="p_body">
            <h4>title</h4>
            <span>message</span>
        </div>
    </div>
</div>

<div id="tplPeople" style="display:none">

</div>

<div class="Searcher">
    <div class="searchInput">
        <input placeholder="订货日期/订单编号/联系人名称/手机号/公司名称" />
        <div class="button btnGO">搜索</div>
    </div>
    <span>常用搜索：</span><a class="todayOrder" target="_blank" href="/MyBiz/Find?key=">今日订单</a>
</div>

<script>
    window.success = function (title,msg, delay, fnCallback) {
        var cnt = $("#tplPrompt>.prompt_success").clone();
        cnt.children(".p_body").children("h4").vl(title);
        cnt.children(".p_body").children("span").vl(msg);
        var p = new LiberUI.Prompt(cnt);
        p.option("Delay", delay);
        p.update();
        if (ObjHelper.IsFunc(fnCallback)) {
            p.on("disposed", fnCallback);
        }
        return p.show();
        
    };
    window.info = function (title,msg, delay,fnCallback) {
        var cnt = $("#tplPrompt>.prompt_info").clone();
        cnt.children(".p_body").children("h4").vl(title);
        cnt.children(".p_body").children("span").vl(msg);
        var p = new LiberUI.Prompt(cnt);
        p.option("Delay", delay);
        p.update();
        if (ObjHelper.IsFunc(fnCallback)) {
            p.on("disposed", fnCallback);
        }
        return p.show();
    };
    window.error = function (title, msg, delay, fnCallback) {
        var cnt = $("#tplPrompt>.prompt_err").clone();
        cnt.children(".p_body").children("h4").vl(title);
        cnt.children(".p_body").children("span").vl(msg);
        var p = new LiberUI.Prompt(cnt);
        p.option("Delay", delay);
        p.update();
        if (ObjHelper.IsFunc(fnCallback)) {
            p.on("disposed", fnCallback);
        }
        return p.show();
    };

    $(".Searcher>.todayOrder").attr("href", "/MyBiz/Find?key=" + new Date().toString());
    $(".searchInput>.btnGO").on("click", function () {
        var k = $(".searchInput>input").vl();
        if (k) {
            window.open("/MyBiz/Find?key=" + escape(k));
        }
    });
    KeybordHelper.on($(".searchInput>input"), "enter", function () {
        var k = $(".searchInput>input").vl();
        if (k) {
            window.open("/MyBiz/Find?key=" + escape(k));
        }
    });
</script>